.class public Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;
.super Landroid/os/AsyncTask;
.source "TopDeals.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lde/dealdoktor/app/activities/TopDeals;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4
    name = "GetBookmarksTask"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask",
        "<",
        "Ljava/lang/String;",
        "Ljava/lang/Void;",
        "Ljava/lang/Boolean;",
        ">;"
    }
.end annotation


# instance fields
.field private posts:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lde/dealdoktor/app/data/PostDAO;",
            ">;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lde/dealdoktor/app/activities/TopDeals;


# direct methods
.method public constructor <init>(Lde/dealdoktor/app/activities/TopDeals;)V
    .locals 0
    .parameter

    .prologue
    .line 139
    iput-object p1, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    .line 138
    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    return-void
.end method


# virtual methods
.method protected varargs doInBackground([Ljava/lang/String;)Ljava/lang/Boolean;
    .locals 3
    .parameter "args"

    .prologue
    .line 169
    :try_start_0
    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    #getter for: Lde/dealdoktor/app/activities/TopDeals;->bookmarks:Ljava/util/ArrayList;
    invoke-static {v1}, Lde/dealdoktor/app/activities/TopDeals;->access$1(Lde/dealdoktor/app/activities/TopDeals;)Ljava/util/ArrayList;

    move-result-object v1

    invoke-static {v1}, Lde/dealdoktor/app/data/DataModel;->getPostsForIds(Ljava/util/ArrayList;)Ljava/util/ArrayList;

    move-result-object v1

    iput-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->posts:Ljava/util/ArrayList;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 174
    const/4 v1, 0x1

    invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v1

    :goto_0
    return-object v1

    .line 170
    :catch_0
    move-exception v0

    .line 171
    .local v0, e:Ljava/lang/Exception;
    const-string v1, "exception"

    const-string v2, "GetBookmarksTask doInBackground"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 172
    const/4 v1, 0x0

    invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v1

    goto :goto_0
.end method

.method protected bridge varargs synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .parameter

    .prologue
    .line 1
    check-cast p1, [Ljava/lang/String;

    invoke-virtual {p0, p1}, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->doInBackground([Ljava/lang/String;)Ljava/lang/Boolean;

    move-result-object v0

    return-object v0
.end method

.method protected onPostExecute(Ljava/lang/Boolean;)V
    .locals 3
    .parameter "success"

    .prologue
    const/16 v2, 0x8

    .line 153
    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-nez v0, :cond_0

    .line 154
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v2}, Landroid/view/View;->setVisibility(I)V

    .line 155
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v1, v1, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->removeFooterView(Landroid/view/View;)Z

    .line 164
    :goto_0
    return-void

    .line 158
    :cond_0
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    invoke-virtual {v0}, Lde/dealdoktor/app/adapter/PostListAdapter;->clear()V

    .line 159
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->posts:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_1

    .line 160
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->posts:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Lde/dealdoktor/app/adapter/PostListAdapter;->addData(Ljava/util/ArrayList;)V

    .line 162
    :cond_1
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v2}, Landroid/view/View;->setVisibility(I)V

    .line 163
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v1, v1, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->removeFooterView(Landroid/view/View;)Z

    goto :goto_0
.end method

.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    check-cast p1, Ljava/lang/Boolean;

    invoke-virtual {p0, p1}, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->onPostExecute(Ljava/lang/Boolean;)V

    return-void
.end method

.method protected onPreExecute()V
    .locals 5

    .prologue
    .line 144
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v1, v1, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->addFooterView(Landroid/view/View;)V

    .line 145
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    new-instance v1, Lde/dealdoktor/app/adapter/PostListAdapter;

    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    iget-object v3, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v4, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v4, v4, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    invoke-direct {v1, v2, v3, v4}, Lde/dealdoktor/app/adapter/PostListAdapter;-><init>(Ljava/util/ArrayList;Lde/dealdoktor/app/activities/SuperListing;Landroid/widget/ListView;)V

    iput-object v1, v0, Lde/dealdoktor/app/activities/TopDeals;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    .line 146
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v1, v1, Lde/dealdoktor/app/activities/TopDeals;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 147
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetBookmarksTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    .line 148
    return-void
.end method
